package nighttest.day11;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Random;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 * @author Xiloer
 *
 */
public class test3 {
    public static void main(String[] args) {
        Collection list = new ArrayList();
        while(list.size()<10){
            Random a = new Random();
            int y = a.nextInt(101);
            if(!list.contains(y)){
                list.add(y);
            }
        }
        System.out.println(list);
    }
}